import { Component, OnInit } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { News } from '../../providers/news-data/news';
import { NewsCommentPage } from '../news-comment/news-comment';


@Component({
  selector: 'page-news-detail',
  templateUrl: 'news-detail.html',
})
export class NewsDetailPage implements OnInit{

  news: News;

  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ngOnInit(): void {
    //Called after the constructor, initializing input properties, and the first call to ngOnChanges.
    //Add 'implements OnInit' to the class.
    this.news = this.navParams.get('news');
  }


  ionViewDidLoad() {
    
  }

  comment(){
    this.navCtrl.push(NewsCommentPage,{news:this.news});
  }

  

}
